package com.by.controller;

import com.by.entity.ResultBean;
import com.by.entity.Spu;
import com.by.service.SpuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 江俊俊
 * @version 1.0
 * @description
 * @date 2025/4/16 16:59
 * @since JDK1.8
 */
@RestController
@RequestMapping("/api")
@Api(tags = "spu管理")
public class SpuController extends BaseController{


    @Autowired
    SpuService spuService;

    @ApiOperation("根据spuId查询商品spu信息")
    @GetMapping("/spu")
    public ResultBean getSpuBySpuId(Long spuId){

        Spu spu = spuService.querySpuBySpuId(spuId);
        return success("查询数据成功",spu);

    }

}
